# 使用if语句进行条件判断
cars = ['audi', 'bmw', 'subaru', 'toyota']
for car in cars:
    if car == 'bmw':
        print(car.upper())
    else:
        print(car.title())

# 检查是否相等（下面的测试会考虑大小写）
string = 'Test'
print(string == 'Test')
age = 19
print(age == 19)

# 检查多个条件（使用and和or）
age1 = 20
age2 = 19
print((age1 > 19) and (age2 < 20))
print((age1 > 19) or (age2 < 19))

# 检查特定值是否在列表中
cars = ['audi', 'bmw', 'subaru', 'toyota']
print('audi' in cars)
# 检查特定值是否不包含在列表中
user = 'bmw1'
if user not in cars:
    print("false")

# if-elif-else语句
age = 12
if age < 4:
    print("Your admission cost is $0.")
elif age < 18:
    print("Your admission cost is $5.")
else:
    print("Your admission cost is $10.")

# 确定列表不是空的
requested_toppings = []
if requested_toppings:
    for requested_topping in requested_toppings:
        print("Adding " + requested_topping + ".")
    print("\nFinished making your pizza!")
else:
    print("Are you sure you want a plain pizza?")

# 使用多个列表
available_toppings = ['mushrooms', 'olives', 'green peppers', 'pepperoni', 'pineapple', 'extra cheese']
requested_toppings = ['mushrooms', 'french fries', 'extra cheese']
for requested_topping in requested_toppings:
    if requested_topping in available_toppings:
        print("Adding " + requested_topping + ".")
else:
    print("Sorry, we don't have " + requested_topping + ".")
print("\nFinished making your pizza!")

